﻿using PetaPoco;
using System;
using System.Collections.Generic;
using System.Text;

namespace Rswl.Common.Core.User.Aggregate.Entities
{
    [TableName("rswl_shippingaddress_info")]
    [PrimaryKey("Id")]
    public class ShippingAddressInfo
    {
        public ShippingAddressInfo()
        {

        }
        public ShippingAddressInfo(string userId,string name,string phone,string province,string city,string county,string areacode,string postalcode,string addressdetail,bool isDefault=false)
        {
            UserId = userId;
            TrueName = name;
            TelPhone = phone;
            Province = province;
            City = city;
            County = county;
            AreaCode = areacode;
            PostalCode = postalcode;
            AddressDetail = addressdetail;
            IsDefault = isDefault;
        }
        public void SetDefault()
        {
            IsDefault = true;
        }

        public void CancelDefault()
        {
            IsDefault = false;
        }

        [Column("UserId")]
        public string UserId { get; set; } = "";
        [Column("Id")]
        public long Id { get; set; }
        /// <summary>
        /// 姓名
        /// </summary>
        [Column("TrueName")] public string TrueName { get; set; } = "";

		[Column("TelPhone")] public string TelPhone { get; set; } = "";
        /// <summary>
        /// 国家
        /// </summary>
        [Column("Country")] public string Country { get; set; } = "";

        [Column("Province")] public string Province { get; set; } = "";

		[Column("City")] public string City { get; set; } = "";
        [Column("County")] public string County { get; set; } = "";
        
        [Column("AreaCode")] public string AreaCode { get; set; } = "";

        [Column("PostalCode")] public string PostalCode { get; set; } = "";

        [Column("AddressDetail")] public string AddressDetail { get; set; } = "";

        [Column("IsDefault")] public bool IsDefault { get; set; }


    }
}
